package com.sg.controller.pbff;

import com.sg.service.biz.pbff.BusinessObjectService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "BusinessObject", tags = {"BusinessObject"})
@RestController
// @RequestMapping("/poms/businessObject/")
public class BusinessObjectController {
    @Autowired
    BusinessObjectService businessObjectService;

    /**
     * B1-1新增业务对象（平台）
     * gen by moon at 8/10/2022, 3:39:28 AM
     */
    @PostMapping("/oms/platform/businessObject/addBizObject")
    @ApiOperation(value = "B1-1新增业务对象（平台）", response = OkrResult.class)
    public OkrResult<BffAddBizObjectRespDto> addBizObject(@RequestBody(required = false) @Validated BffAddBizObjectReqDto reqDTO) {
        return OkrResult.success(businessObjectService.addBizObject(reqDTO));
    }

    /**
     * B1-1查询业务对象列表（平台）
     * gen by moon at 8/31/2022, 7:28:45 PM
     */
    @PostMapping("/oms/platform/businessObject/queryBizObjectList")
    @ApiOperation(value = "B1-1查询业务对象列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryBizObjectListRespDto> queryBizObjectList(@RequestBody(required = false) @Validated BffQueryBizObjectListReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryBizObjectList(reqDTO));
    }

    /**
     * B1-1查询存档条件对象属性类型关系列表（平台）
     * gen by moon at 8/10/2022, 3:43:03 AM
     */
    @PostMapping("/oms/platform/businessObject/queryArchiveObjTypeRelation")
    @ApiOperation(value = "B1-1查询存档条件对象属性类型关系列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryArchiveObjTypeRelationRespDto> queryArchiveObjTypeRelation(@RequestBody(required = false) @Validated BffQueryArchiveObjTypeRelationReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryArchiveObjTypeRelation(reqDTO));
    }

    /**
     * B1-1查询存档条件对象属性列表
     * gen by moon at 8/10/2022, 3:40:45 AM
     */
    @PostMapping("/oms/platform/businessObject/queryArchiveObjAttribute")
    @ApiOperation(value = "B1-1查询存档条件对象属性列表", response = OkrResult.class)
    public OkrResult<BffQueryArchiveObjAttributeRespDto> queryArchiveObjAttribute(@RequestBody(required = false) @Validated BffQueryArchiveObjAttributeReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryArchiveObjAttribute(reqDTO));
    }

    /**
     * B1-1查询对象属性类型关系列表（平台）
     * gen by moon at 8/10/2022, 3:40:14 AM
     */
    @PostMapping("/oms/platform/businessObject/queryObjTypeRelationList")
    @ApiOperation(value = "B1-1查询对象属性类型关系列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryObjTypeRelationListRespDto> queryObjTypeRelationList(@RequestBody(required = false) @Validated BffQueryObjTypeRelationListReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryObjTypeRelationList(reqDTO));
    }

    /**
     * B1-1修改对象属性类型关系（平台）
     * gen by moon at 8/10/2022, 3:40:12 AM
     */
    @PostMapping("/oms/platform/businessObject/updateObjTypeRelation")
    @ApiOperation(value = "B1-1修改对象属性类型关系（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateObjTypeRelationRespDto> updateObjTypeRelation(@RequestBody(required = false) @Validated BffUpdateObjTypeRelationReqDto reqDTO) {
        return OkrResult.success(businessObjectService.updateObjTypeRelation(reqDTO));
    }

    /**
     * B1-1新增对象属性类型关系（平台）
     * gen by moon at 8/10/2022, 3:40:11 AM
     */
    @PostMapping("/oms/platform/businessObject/addObjTypeRelation")
    @ApiOperation(value = "B1-1新增对象属性类型关系（平台）", response = OkrResult.class)
    public OkrResult<BffAddObjTypeRelationRespDto> addObjTypeRelation(@RequestBody(required = false) @Validated BffAddObjTypeRelationReqDto reqDTO) {
        return OkrResult.success(businessObjectService.addObjTypeRelation(reqDTO));
    }

    /**
     * B1-1查询枚举字段对象属性详情（平台）
     * gen by moon at 8/10/2022, 3:40:07 AM
     */
    @PostMapping("/oms/platform/businessObject/queryObjAttributeDetail")
    @ApiOperation(value = "B1-1查询枚举字段对象属性详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryObjAttributeDetailRespDto> queryObjAttributeDetail(@RequestBody(required = false) @Validated BffQueryObjAttributeDetailReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryObjAttributeDetail(reqDTO));
    }

    /**
     * B1-1查询枚举字段对象属性列表（平台）
     * gen by moon at 8/10/2022, 3:40:06 AM
     */
    @PostMapping("/oms/platform/businessObject/queryEnumObjAttributeList")
    @ApiOperation(value = "B1-1查询枚举字段对象属性列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryEnumObjAttributeListRespDto> queryEnumObjAttributeList(@RequestBody(required = false) @Validated BffQueryEnumObjAttributeListReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryEnumObjAttributeList(reqDTO));
    }

    /**
     * B1-1修改对象属性（平台）
     * gen by moon at 9/11/2022, 5:19:22 AM
     */
    @PostMapping("/oms/platform/businessObject/updateObjAttribute")
    @ApiOperation(value = "B1-1修改对象属性（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateObjAttributeRespDto> updateObjAttribute(@RequestBody(required = false) @Validated BffUpdateObjAttributeReqDto reqDTO) {
        return OkrResult.success(businessObjectService.updateObjAttribute(reqDTO));
    }

    /**
     * B1-1查询对象属性列表（平台）
     * gen by moon at 9/11/2022, 5:19:21 AM
     */
    @PostMapping("/oms/platform/businessObject/queryObjAttributeList")
    @ApiOperation(value = "B1-1查询对象属性列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryObjAttributeListRespDto> queryObjAttributeList(@RequestBody(required = false) @Validated BffQueryObjAttributeListReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryObjAttributeList(reqDTO));
    }

    /**
     * B1-1新增对象属性（平台）
     * gen by moon at 9/2/2022, 3:00:40 PM
     */
    @PostMapping("/oms/platform/businessObject/addObjAttribute")
    @ApiOperation(value = "B1-1新增对象属性（平台）", response = OkrResult.class)
    public OkrResult<BffAddObjAttributeRespDto> addObjAttribute(@RequestBody(required = false) @Validated BffAddObjAttributeReqDto reqDTO) {
        return OkrResult.success(businessObjectService.addObjAttribute(reqDTO));
    }

    /**
     * B1-1查询业务对象详情（平台）
     * gen by moon at 8/10/2022, 3:39:32 AM
     */
    @PostMapping("/oms/platform/businessObject/queryBizObjectDetail")
    @ApiOperation(value = "B1-1查询业务对象详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryBizObjectDetailRespDto> queryBizObjectDetail(@RequestBody(required = false) @Validated BffQueryBizObjectDetailReqDto reqDTO) {
        return OkrResult.success(businessObjectService.queryBizObjectDetail(reqDTO));
    }

    /**
     * B1-1修改业务对象（平台）
     * gen by moon at 8/10/2022, 3:39:29 AM
     */
    @PostMapping("/oms/platform/businessObject/updateBizObject")
    @ApiOperation(value = "B1-1修改业务对象（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateBizObjectRespDto> updateBizObject(@RequestBody(required = false) @Validated BffUpdateBizObjectReqDto reqDTO) {
        return OkrResult.success(businessObjectService.updateBizObject(reqDTO));
    }

}

